{% load i18n %}
{% load account_tags %}
{% load extra_tagging_tags %}
{% load tasks_tags %}
{% load avatar_tags %}
{% load shorttimesince_tag %}
{% load threadedcommentstags %}
{% load markup_tags %}
{% load group_tags %}
{% load theme_tags %}

<div class="task clearfix">
    <div class="task-meta">
        
        {% if task.assignee %}
            <div class="avatar">{% avatar task.assignee 40 %}</div>
            <div class="details"><b>{% trans "Assignee" %}</b>: <a href="{% groupurl tasks_for_user group username=task.assignee %}">{% user_display task.assignee %}</a></div>
        {% else %}
            <span class="warning">{% trans "Unassigned" %}</span>
        {% endif %}
        <div><b>{% trans "State" %}</b>: {{ task.get_state_display }}</div>
        <div><b>{% trans "Creator" %}</b>: <a href="{% groupurl tasks_for_user group username=task.creator %}">{% user_display task.creator %}</a></div>
        <div><b>{% trans "Created" %}</b>: {{ task.created|date }}</div>
        <div><b>{% trans "Modified" %}</b>: {{ task.modified|shorttimesince }} ago</div>
        <div><a href="{% groupurl tasks_history group id=task.id %}">{% trans "History of this Task" %}</a></div>
        <div><b>Nudges</b>: {{ nudge.count }}
            {% if nudge.history %}
                <a href="#" id="nudge-history">nudge list</a>
            {% endif %}
        </div>
        {% if nudge.history %}
            <div id="nudge-history-target">
                <ol>
                {% for item in nudge.history %}
                     <li><a href="{% groupurl tasks_for_user group username=item.nudger %}">{% user_display item.nudger %}</a>
                    {{ item.modified|shorttimesince }}</li>
                {% endfor %}
                </ol>
            </div>
        {% endif %}
        <div>
            {% if nudge.nudgeable %}
                {% if nudge.nudge %}
                    You have nudged this task.<br />
                    <a href="{% groupurl tasks_nudge group id=task.id %}">Denudge task</a>
                {% else %}
                    <a href="{% groupurl tasks_nudge group id=task.id %}">nudge task</a>
                {% endif %}
            {% endif %}
        </div>
    </div>
    <div class="bulk">
        <h2 class="task_{{ task.get_state_display }}">#{{ task.id }}: <a href="{{ task.get_absolute_url }}">{{ task.summary }}</a></h2>
        <div class="body">
            {{ task.detail|apply_markup:task.markup }}
        </div>
        <div class="task-meta2">
            {% get_comment_count for task as comment_count %}
            {% if comment_count %}
                {{ comment_count }} comment{{ comment_count|pluralize }};
            {% endif %}
            <b>{% trans "Status" %}</b>:
            {% if task.status %}
                {{ task.status }}
            {% else %}
                {% trans "none" %}
            {% endif %}
        </div>
        <p>{% silk "tag_blue" %} {% task_tags task group %}</p>
    </div>
</div>
